package com.sangananitsolution.fragments;

import java.util.ArrayList;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

import com.sangananitsolution.database.UserInfoCRUD;
import com.sangananitsolution.gogoproject.R;

/**
 * @author Vishwapratap 
 *
 */
public class MyFavouirte extends android.app.Fragment {

	EditText etfName, etlName, etemail, etcountry, etphone;

	@Override
	public View onCreateView(LayoutInflater inflater,
			 ViewGroup container,  Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view = inflater.inflate(R.layout.myfavouirte, container, false);

		etfName = (EditText) view.findViewById(R.id.etFnamemyfav);
		etlName = (EditText) view.findViewById(R.id.etLnamefav);
		etemail = (EditText) view.findViewById(R.id.etEmailfav);
		etcountry = (EditText) view.findViewById(R.id.etcountryfav);
		etphone = (EditText) view.findViewById(R.id.etPhonefav);

		UserInfoCRUD userInfoCRUD = new UserInfoCRUD(getActivity());
		ArrayList<String> userinfo = userInfoCRUD.getAllData();
		String[] ar = new String[13];
		for (int i = 0; i < userinfo.size(); i++) {

			ar[i] = userinfo.get(i);

		}
		
	
		etfName.setText(ar[0]);
		etlName.setText(ar[1]);
		etemail.setText(ar[2]);
		etphone.setText(ar[3]);
		etcountry.setText(ar[4]);
		

		return view;
	}
}
